import request from '@/utils/request';
import { message } from 'ant-design-vue';
import { getOptFn } from '@/utils/getOptions.js';

export async function addOptFn(arr) {
  arr.forEach((item, index) => {
    let opt = [];
    if (
      (item.type == 'radioselect' ||
        item.type == 'select' ||
        item.type == 'selectajax' ||
        item.type == 'selectajaxlike') &&
      item.action
    ) {
      //item.action = item.action.replace(/_list/g, '_select');
      getOptFn(item.action, '', (r) => {
        item.options = r;
      });
    }
  });
}

export default addOptFn;
